<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #div1{
            width:200px;
            height:200px;
            background: purple;
        }
    </style>
</head>
<body>
    <div id="div1"  onclick="changeDiv(this)">

    </div>

    <script>
        /*需求：点击上面的div，改变Div的宽高和背景颜色*/
        function changeDiv(obj){
            obj.style.width = "400px"
            obj.style.height = "400px"
            obj.style.background = "red"
        }
    </script>
</body>
</html>